#include <stdio.h>
#include <string.h>
#include <math.h>

char in[5000];
struct ddd
{
	double v;
	int  en;
}data[4]; // 1- U 2-I 3-P


int findden(char *s)
{
	int i,len;
	len=strlen(s);
	for (i=0;i<len;i++)
		if (s[i]=='=')
			return i;
	return -1;
}

main()
{
	int icase, ncase;
	int site,i,j,type;
	char ch;
	double value;

	scanf("%d", &ncase);
//	gets(in);
	for (icase=1;icase<=ncase;icase++)
	{	
		for (i=1;i<=3;i++) data[i].en=0;
		j=0;
		while  (j++<2)
		{
			scanf("%s", in);
			while (findden(in)==-1) 
				scanf("%s", in);

			site=findden(in);
			ch=in[site-1];
			switch (ch)
			{
				case 'U':{type=1;break;}
				case 'I':{type=2;break;}
				case 'P':{type=3;break;}
			}
			sscanf(in+site+1,"%lf%c", &value, &ch);
			switch (ch)
			{
				case 'm':value*=0.001;break;
				case 'k':value*=1000;break;
				case 'M':value*=1e6;break;
			}
			data[type].en=1;
			data[type].v=value;
			in[site]='a';
		}
		printf("Problem #%d\n",icase);
		if (data[1].en==0)
		{
			printf("U=%.2lfV\n",data[3].v/data[2].v);
			
		}
		else if (data[2].en==0)
		{
			printf("I=%.2lfA\n",data[3].v/data[1].v);

		}
		else if (data[3].en==0)
		{
			printf("P=%.2lfW\n",data[1].v*data[2].v);

		}
		printf("\n");


		



		
		

	}

	return 0;
}
